Skip to content

Conversation

ruhulamin1398
Copy link

@ruhulamin1398 ruhulamin1398 commented Jul 15, 2025

Summary

This PR improves the ERC20Custodian contract by:

  • Fixing the freeze function to allow freezing up to the user's total balance rather than just the available (unfrozen) balance.
  • Adding edge test cases covering full balance freeze, zero freeze, and updates to frozen amounts.
  • Removing unused code: the TokensUnfrozen event and ERC20InsufficientFrozenBalance error which were declared but never used.
  • Updating NatSpec comments in the contract for clarity.
  • Updating the documentation Markdown file to reflect the revised behavior.

Changes

  • ✅ Updated freeze() to check against balanceOf() instead of availableBalance()
  • ✅ Added edge test cases for freezing entire balance, freezing zero tokens, and modifying frozen balances
  • ✅ Removed unused TokensUnfrozen event and ERC20InsufficientFrozenBalance error
  • ✅ Improved doc comments in the Solidity contract
  • ✅ Updated docs/token/ERC20/extensions/ERC20Custodian.md to match code changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant